<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="test.js"></script>
    <script>
        function f(){
            var x=10;
            var y="abc";
            document.getElementById('display').innerHTML=x;
        }
        function g(){
            alert(x+9);
            document.getElementById('display').innerHTML=x;
        }
    </script>
    <a onclick="f()">ffffffff</a>
    <a onclick="g()">gggggggg</a>
    <div id="display"></div>
</body>
</html>